<template>
	<div class="app-container approve-item">
		<el-form ref="form" :model="form" label-width="80px">
			<el-row>
				<el-col :span="21" class="approver">
					<el-form-item label="申请账号" prop="approver">
						<el-input v-model="form.userName" readonly  />
					</el-form-item>
            <!--驳回-- 0 驳回 1通过 2 申请中 3撤销----->
               <img class="status-img" v-if="form.status==0" src="@/assets/images/DMS/system/rejected.png" alt=""> 
               <!--1通过-->
               <img class="status-img" v-if="form.status==1" src="@/assets/images/DMS/system/pass.png" alt="">
               <!--申请中-->
               <img class="status-img" v-if="form.status==2" src="@/assets/images/DMS/system/applying.png" alt="">
               <!--3撤销-->
               <img class="status-img" v-if="form.status==3" src="@/assets/images/DMS/system/repeal.png" alt="">
            </el-col>
				<el-col :span="21">
					<el-form-item label="申请原因" prop="applyReason">
						<el-input type="textarea" v-model="form.applyReason" readonly />
					</el-form-item>
				</el-col>
				<el-col :span="21">
					<el-form-item label="申请详情" prop="realname">
						<el-table :data="form.list" border>
							<el-table-column label="表单名称" prop="tableName" align="center"></el-table-column>
							<el-table-column label="表单名称(数据库)" prop="tableAlias" align="center"></el-table-column>
                     <el-table-column label="所属部门" prop="deptName" align="center"></el-table-column>
                     <el-table-column label="安全等级" prop="safeLevel" align="center"></el-table-column>
							<el-table-column label="申请类型" prop="accessType" align="center">
								<template slot-scope="scope">
									<span v-if="scope.row.accessType==1">只读</span>
									<span v-if="scope.row.accessType==2">可读可导出</span>
									<span v-if="scope.row.accessType==3">内容编辑</span>
									<span v-if="scope.row.accessType==4">元数据编辑</span>
									<span v-if="scope.row.accessType==5">管理权限</span>
								</template>
							</el-table-column>
						</el-table>
					</el-form-item>
				</el-col>
			</el-row>
		</el-form>


		<div style="text-align: center; margin:20px 0">
				<!--<el-button type="info" v-if="form.status==0" disabled>已驳回</el-button>
				<el-button type="info" v-else-if="form.status==1" disabled>已通过</el-button>--->
			<el-button style="min-width:84px;" @click="reback">退出</el-button>
		</div>
	</div>
</template>

<script>
	import { getApply } from "@/api/dataManagement/system/apply";
	export default {
		data() {
			return {
				// 表单参数
				form: {},
				rejectVisible: false,
				comment: ''
			}
		},
		created() {
			this.getApplyItem()
		},
		methods: {
			getApplyItem() {
				getApply(this.$route.query.id).then(res => {
					this.form = res.data
					console.log(res.data,12131131321);
				})
			},
			// 返回
			reback() {
				this.$router.push({ path: '/DMS/myData/logRecord'})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.approve-item {
		padding: 50px 35px 70px 70px;
	}
 
   .status-img{
      position:absolute;
      top:-28px;
      right:0;
   }
</style>